<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of hog</title>
  <meta name="keywords" content="hog">
  <meta name="description" content="Efficiently compute histogram of oriented gradient (HOG) features.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html images -->
<h1>hog
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Efficiently compute histogram of oriented gradient (HOG) features.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function H = hog( I, varargin ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Efficiently compute histogram of oriented gradient (HOG) features.

 Code to compute HOG features as described in &quot;Histograms of Oriented
 Gradients for Human Detection&quot; by Dalal &amp; Triggs, CVPR05. Various speedup
 tricks adopted from the HOG code feature.cpp by Deva Ramanan.

 If I has dimensions [mxn], the size of the computed feature vector H is
 [m/sBin-2 n/sBin-2 oBin*4]. For each non-overlapping sBin x sBin region,
 computes a histogram of gradients, with each gradient quantized by it's
 angle and weighed by its magnitude. For color images, the gradient is
 computed separately for each color channel and the one with maximum
 magnitude is used. The centered gradient is used except at boundaries
 (where uncentered gradient is used). Trilinear interpolation is used to
 place each gradient in the appropriate spatial and orientation bin. For
 each resulting histogram (with oBin bins), four different normalizations
 are computed using adjacent histograms, resulting in an oBins*4 length
 feature vector for each region. Boundary regions are discarded.

 The computed features are NOT identical to those described in the CVPR05
 paper. Specifically, there is no Gaussian spatial window, and other minor
 details differ. The choices were made for speed of the resulting code:
 ~.1s for a 640x480x3 color image on a standard machine from 2005. Further
 speedups can be obtained by not using trilinear interpolation (e.g.,
 setting oGran=1 results in a ~33% speedup at some loss in accuracy).

 USAGE
  H = hog( I, [sBin], [oBin], [oGran] )

 INPUTS
  I        - [mxn] color or grayscale input image (must have type double)
  sBin     - [8] spatial bin size
  oBin     - [9] number of orientation bins
  oGran    - [10] controls quality of linear interpolation for orientation

 OUTPUTS
  H        - [m/sBin-2 n/sBin-2 oBin*4] computed hog features

 EXAMPLE
  I=double(imread('cameraman.tif')); figure(1); im(I)
  tic, H=hog(I,8,9); toc, V=hogDraw(H,25); figure(2); im(V)

 See also <a href="hogDraw.html" class="code" title="function V = hogDraw( H, w )">hogDraw</a>

 Piotr's Image&amp;Video Toolbox      Version 2.42
 Copyright 2010 Piotr Dollar.  [pdollar-at-caltech.edu]
 Please email me if you find bugs, or have suggestions or questions!
 Licensed under the Lesser GPL [see external/lgpl.txt]</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->




<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
